package com.briup.demo.service.impl;

import com.briup.demo.bean.role_privilege;
import com.briup.demo.dao.role_privilegeMapper;
import com.briup.demo.service.Irole_privilegeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class role_privilegeServiceImpl implements Irole_privilegeService {
@Resource
    private role_privilegeMapper role_privilegeMapper;
    @Override
    public List<role_privilege> findAll() {
        return role_privilegeMapper.selectAll();
    }

    @Override
    public void saveOrUpdate(role_privilege privilege) {
        if(privilege.getId()!=null){
            role_privilegeMapper.update(privilege);
        }
        else {
            role_privilegeMapper.insert(privilege);
        }
    }

    @Override
    public void delete(Long id) {
        role_privilegeMapper.delete(id);
    }
}
